<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        
        li {
            list-style: none;
        }
        
        #wrapper {
            width: 80vw;
            height: 80vh;
            overflow: hidden;
        }
        
        #wrapper li {
            width: 80vw;
            height: 80vh;
        }
        
        .red {
            background-color: red;
        }
        
        .green {
            background-color: green;
        }
        
        .blue {
            background-color: blue;
        }
        
        #wrapper2 {
            width: 100vw;
            overflow: hidden;
        }
        
        #wrapper2 ul {
            display: flex;
            width: 120vw;
        }
        
        #wrapper2 li {
            border: 1px solid red;
            flex: 1;
            height: calc( 100% - 1px);
            box-sizing: border-box;
        }
    </style>
</head>

<body>
    <div id="wrapper">
        <ul class="content">
            <li class="red"><button id="one">one</button></li>
            <li class="green"></li>
            <li class="blue"></li>
        </ul>
    </div>

    <div id="wrapper2">
        <ul class="content">
            <li>新闻</li>
            <li>体育</li>
            <li>社会</li>
            <li>新闻</li>
            <li>体育</li>
            <li>社会</li>
        </ul>
    </div>

    <!-- <script src="https://unpkg.com/@better-scroll/core@latest/dist/core.js"></script> -->
    <script src="https://unpkg.com/better-scroll@latest/dist/better-scroll.min.js"></script>
    <script>
        // let bs = BetterScroll.createBScroll('.wrapper', {})

        // 生成bs实例 就可以实现默认的纵向滚动效果
        var bs = BetterScroll.createBScroll('#wrapper', {})


        var bs2 = BetterScroll.createBScroll('#wrapper2', {
            scrollX: true,  // scrollX 开启横向滚动效果
            bounce: false   // bounce属性 可以开启或关闭回弹效果
        })

        console.log(bs)
    </script>
</body>

</html>